BUILD_DIR = ./build
TARGET = $(BUILD_DIR)/PLFinder
SRCS = $(wildcard *.cpp)
OBJS = $(patsubst %.cpp, $(BUILD_DIR)/%.o, $(SRCS))
DEPS = $(OBJS:.o=.d)
CXXFLAGS = -O3 -std=c++23

$(TARGET): $(OBJS)
	$(CXX) $^ -o $@
	
$(BUILD_DIR)/%.o: %.cpp
	$(CXX) -c $(CXXFLAGS) $< -o $@ -MMD -MF $(BUILD_DIR)/$*.d 

.PHONY: clean
clean: 
	rm -f $(BUILD_DIR)/*.d $(BUILD_DIR)/*.o

-include $(DEPS)	

